<div data-bind="modal: isShow" class="modal fade" data-backdrop="static" data-keyboard="false">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button class="close" data-bind="click: onHide"><i class="fa fa-close"></i></button>
                <h4 class="modal-title" data-bind="text: Kooboo.text.component.proposalModal.proposal"></h4>
            </div>
            <div class="modal-body">
                <!-- ko if: mode() == 'edit' -->
                <div class="row">
                    <div class="col-md-12 margin-bottom-15">
                        <div class="form-group">
                            <label data-bind="text: Kooboo.text.common.description"></label>
                            <textarea class="autosize form-control" data-bind="value: description" style="min-height: 50px;"></textarea>
                        </div>
                    </div>
                    <div class="col-md-6 margin-bottom-15">
                        <div class="form-group">
                            <label data-bind="text: Kooboo.text.component.proposalModal.duration, textError: duration"></label>
                            <div class="input-group">
                                <input type="text" class="form-control" data-bind="value: duration, event: { keydown: Kooboo.event.input.positiveIntegerOnly }">
                                <span class="input-group-addon" data-bind="text: Kooboo.text.component.proposalModal.days"></span>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-6 margin-bottom-15">
                        <div class="form-group">
                            <label data-bind="text: Kooboo.text.common.budget"></label>
                            <div class="input-group">
                                <span class="input-group-addon" data-bind="text: currencySymbol, attr: { title: currencyCode }"></span>
                                <input type="number" class="form-control" data-bind="value: budget, event: { keydown: Kooboo.event.input.positiveNumberOnly }">
                            </div>
                        </div>
                    </div>
                    <div class="col-md-12 margin-bottom-15">
                        <div class="form-group">
                            <label data-bind="text: Kooboo.text.common.attachments"></label>
                            <div class="form-inline">
                                <button class="btn btn-info btn-file">
                                    <input type="file"  data-bind="upload: {
                                    allowMutiple: false,
                                    acceptTypes: ['*/*'],
                                    callback: uploadFile
                                }">
                                <!-- ko text: Kooboo.text.common.upload -->
                                <!-- /ko -->
                            </button>
                                <div class="form-group">
                                    <p class="form-control-static">
                                        <!-- ko foreach: attachments -->
                                        <button class="btn btn-default">
                                            <!-- ko text: $data.fileName -->
                                            <!-- /ko -->
                                            <i class="fa fa-close" data-bind="click: $parent.removeFile.bind(this, $data)"></i>
                                        </button>
                                        <!-- /ko -->
                                    </p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- /ko -->
                <!-- ko if: mode() == 'view' -->
                <div class="row">
                    <div class="col-md-4">
                        <div class="form-group">
                            <label data-bind="text: Kooboo.text.component.proposalModal.bidder"></label>
                            <p class="form-control-static" data-bind="text: userName"></p>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="form-group">
                            <label data-bind="text: Kooboo.text.component.proposalModal.duration"></label>
                            <p class="form-control-static" data-bind="text: displayDuration"></p>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="form-group">
                            <label data-bind="text: Kooboo.text.common.budget"></label>
                            <p class="form-control-static" data-bind="text: displayBudget, attr: { title: currencyCode }"></p>
                        </div>
                    </div>
                    <div class="col-md-12">
                        <div class="form-group">
                            <label data-bind="text: Kooboo.text.common.description"></label>
                            <p class="form-control-static" data-bind="text: description"></p>
                        </div>
                    </div>
                </div>
                <!-- /ko -->
            </div>
            <div class="modal-footer">
                <!-- ko if: mode() == 'edit' -->
                <button class="btn green" data-bind="text: Kooboo.text.site.form.submit, click: onSave"></button>
                <!-- /ko -->
                <!-- ko if: mode() == 'view' -->
                <button class="btn green" data-bind="text: Kooboo.text.component.proposalModal.accept, click: onAcceptProposal"></button>
                <!-- /ko -->
                <button class="btn gray" data-bind="click: onHide, text: Kooboo.text.common.cancel"></button>
            </div>
        </div>
    </div>
</div>